home *** CD-ROM | disk | FTP | other *** search
- .Na "dbgetchar"
- .Aa
- .Fu
- Return a pointer to a character in the command buffer.
- .Ih "command buffer, returning a character in"
- .Sy
- .Sf "char *dbgetchar(dbproc, n)"
- .Sp "DBPROCESS" "*dbproc"
- .Sp "int" "n"
- .Co
- .Bl
- You can use
- .I "dbgetchar()"
- to find a particular character in the command buffer.
- It returns a pointer to the \f2n\f1'th character in the command
- buffer.
- .Bl
- Internally,
- the command buffer is a linked list of non-null-terminated text strings.
- .I "dbgetchar(), dbstrcpy(),"
- and
- .I "dbstrlen()"
- together provide a way to locate and copy parts of the command buffer.
- .Bl
- Since the command buffer is not just one large text string, but rather a
- linked list of text strings, you must use
- .I "dbgetchar()"
- to index through the buffer.
- If you just get a pointer using
- .I "dbgetchar()"
- and then increment it yourself, it will probably fall off the end of a string
- and cause a segmentation fault.
- .Bz
- .Pa
- .Pi dbproc
- A pointer to the DBPROCESS structure that provides the connection
- for a particular front-end/\*S process. It contains all the
- information that \*L uses to manage communications and data between the
- front end and \*S.
- .Pi n
- The character to find in the command buffer.
- The first character is the 0'th character.
- .in -.375i
- .Re
- .br
- .I "dbgetchar()"
- returns a pointer to the \f2n\f1'th character in the command buffer.
- If
- .I n
- is not in range, \f2dbgetchar()\f1 returns NULL.
- .Sa
- dbcmd,
- dbfcmd,
- dbfreebuf,
- dbstrcpy,
- dbstrlen
-